from django.conf.urls import url
from crm.views import consultant, auth, teacher

urlpatterns = [
    url(r'^login/', auth.login, name='login'),
    url(r'^reg/', auth.reg, name='reg'),

    # 客户表
    url(r'^customer_list/', consultant.CustomerList.as_view(), name='customer_list'),
    url(r'^my_customer_list/', consultant.CustomerList.as_view(), name='my_customer_list'),
    url(r'^customer_add/', consultant.customer_change, name='customer_add'),
    url(r'^customer_edit/(?P<pk>\d+)/', consultant.customer_change, name='customer_edit'),

    # 跟进记录表
    url(r'^consult_record_list/', consultant.ConsultRecordList.as_view(), name='consult_record_list'),
    url(r'^one_consult_record_list/(?P<customer_id>\d+)/', consultant.ConsultRecordList.as_view(),
        name='one_consult_record_list'),
    url(r'^consult_record_add/', consultant.consult_record_change, name='consult_record_add'),
    url(r'^consult_record_edit/(?P<pk>\d+)/', consultant.consult_record_change, name='consult_record_edit'),

    # 报名表
    url(r'^enrollment_list/', consultant.EnrollmentList.as_view(), name='enrollment_list'),
    url(r'^one_enrollment_list/(?P<customer_id>\d+)/', consultant.EnrollmentList.as_view(), name='one_enrollment_list'),
    url(r'^enrollment_add/(?P<customer_id>\d+)', consultant.enrollment_change, name='enrollment_add'),
    url(r'^enrollment_edit/(?P<pk>\d+)/', consultant.enrollment_change, name='enrollment_edit'),

    # 缴费记录表
    url(r'^payment_record_list/', consultant.PaymentRecordList.as_view(), name='payment_record_list'),
    url(r'^one_payment_record_list/(?P<customer_id>\d+)', consultant.PaymentRecordList.as_view(),
        name='one_payment_record_list'),
    url(r'^payment_record_add/(?P<customer_id>\d+)', consultant.payment_change, name='payment_record_add'),
    url(r'^payment_record_edit/(?P<pk>\d+)/', consultant.payment_change, name='payment_record_edit'),

    # 班级表
    url(r'^class_list/', teacher.ClassList.as_view(), name='class_list'),
    url(r'^class_add/', teacher.class_change, name='class_add'),
    url(r'^class_edit/(?P<pk>\d+)/', teacher.class_change, name='class_edit'),

    # 课程记录表
    url(r'^course_record_list/(?P<class_id>\d+)/', teacher.CourseRecordList.as_view(), name='course_record_list'),
    url(r'^course_record_add/(?P<class_id>\d+)/', teacher.course_record_change, name='course_record_add'),
    url(r'^course_record_edit/(?P<pk>\d+)/', teacher.course_record_change, name='course_record_edit'),

    # 展示和编辑学习记录表
    url(r'^study_record/(?P<course_record_id>\d+)/', teacher.study_record, name='study_record'),
]
